package cn.newgrand.netcall.integration.message;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import org.jivesoftware.spark.ui.transcript.MessageTranscriptItem;

import cn.newgrand.netcall.integration.AppSysMesPlugin;
import cn.newgrand.netcall.integration.IntegrationManager;
import cn.newgrand.netcall.transcript.HistoryMessageManager;

/**
 * @author SidneyRen E-mail:SidneyRen@hotmail.com
 * @version create time：2010-11-3 下午10:00:01
 * 类说明
 */
public class AppSysMessageItem extends MessageTranscriptItem {
    private String content;
	private MessageParser mp;
    private AbstractAction openAction;
    private String body;
	
    /**
	 *		
	 * 
	 * @param title 标题
	 * @param body 所有的信息内容
	 * @param sendTime 发送时间
	 * @param content 展示的消息内容
	 */
	public AppSysMessageItem(String title,String body, String sendTime,String content) {
		// TODO Auto-generated constructor stub
		super(title, content, sendTime);
		mp = new MessageParser(body);
    	content = mp.getContent();
		
    	openAction = new AbstractAction() {
    		public void actionPerformed(ActionEvent e) {
    			IntegrationManager.getWinInteraction().loginAppSys(mp.getAddress());
    		}
    	};
    	setCustomAction(openAction);
	}
	
	
	
}
